function														...
	[	aafTrainingFeatures,		aiTrainingClasses,			...
		aafTestFeatures,			aiTestClasses			] =	...
			GetTrainingAndTestSets(								...
				tSVMTrainer,									...
				fTrainingVsTestSetDimensionsRatio 				)
	%
	% for readability
	iNumberOfEvents		= numel( tSVMTrainer.atEvents );
	%
	% return if there are no events
	if( iNumberOfEvents <= 0 )
		%
		error('No events have been loaded');
		%
	end;%
	%
	iNumberOfFeatures	= numel( tSVMTrainer.atEvents(1).afFeatures );
	aafFeatures			= zeros(iNumberOfEvents, iNumberOfFeatures);
	aiMeasuredClasses	= zeros(iNumberOfEvents, 1);
	abValidityFlags		= zeros(iNumberOfEvents, 1);
	%
	% get the features matrix and the classes array
	for iEvent = 1:iNumberOfEvents;
		%
		% save the information about the validity
		abValidityFlags(iEvent)	= tSVMTrainer.atEvents(iEvent).bIsValid;
		%
		% save the data only if it is valid
		if( abValidityFlags(iEvent) )
			%
			aafFeatures(iEvent, :)		= tSVMTrainer.atEvents(iEvent).afFeatures;
			aiMeasuredClasses(iEvent)	= PeopleCounters.ConvertClassStringIntoIntegerCode( tSVMTrainer.atEvents(iEvent).strMeasuredClass );
			%
		end;%
		%
	end;% cycle on the various events
	%
	% remove the invalid data
	aafFeatures			= aafFeatures( abValidityFlags == true, : );
	aiMeasuredClasses	= aiMeasuredClasses( abValidityFlags == true );
	%
	% !!! notice that, since we remove some data, the number of events can
	% change
	iNumberOfValidEvents = numel( aiMeasuredClasses );
	%
	iNumberOfDataInTrainingSet = ...
		round( iNumberOfValidEvents * fTrainingVsTestSetDimensionsRatio );
	%
	aafTrainingFeatures		= aafFeatures(			1:iNumberOfDataInTrainingSet, : );
	aiTrainingClasses		= aiMeasuredClasses(	1:iNumberOfDataInTrainingSet );
	aafTestFeatures			= aafFeatures(			iNumberOfDataInTrainingSet+1:end, : );
	aiTestClasses			= aiMeasuredClasses(	iNumberOfDataInTrainingSet+1:end );
	%
end % function

